<%@ page language="java" contentType="text/html; charset=utf8"%>
<%@page import="java.util.*"%>
<%@page import="com.testingedu.model.TIndexPicture"%>
<%@page import="com.testingedu.jdbcDao.TIndexPictureDao"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<title>网络测试培训网-国内首家专注网络自动化测试_手动测试培训网站</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="description"
			content="网络测试培训网-国内首家专注网络自动化测试_手动测试培训网站,提供网络测试培训,自动化测试培训,手动测试培训,云测试培训服务." />
		<meta name="keywords" content="网络测试培训,自动化测试培训,手动测试培训,云测试培训" />
		<link rel="icon" href="${pageContext.request.contextPath}/favicon.ico" type="image/x-icon"/>
		<link rel="shortcut icon" href="${pageContext.request.contextPath}/favicon.ico"  type="image/x-icon"/>
		<link href="http://www.testingedu.com/theme/reset.css"
			rel="stylesheet" type="text/css" />

		<script src="${pageContext.request.contextPath}/js/jquery-1.7.2.js"
			type="text/javascript">
</script>
		<script src="${pageContext.request.contextPath}/js/jquery.poshytip.js"
			type="text/javascript">
</script>
		<link href="${pageContext.request.contextPath}/css/default.css"
			rel="stylesheet" type="text/css" />
		<link href="${pageContext.request.contextPath}/css/tip-yellow.css"
			rel="stylesheet" type="text/css" />
		<link
			href="${pageContext.request.contextPath}/css/tip-yellowsimple.css"
			rel="stylesheet" type="text/css" />
			<script type="text/javascript"
			src="${pageContext.request.contextPath}/js/jquery.leanModal.min.js">
</script>
		<style type="text/css">
.main  input.input {
	width: 190px;
	height: 26px;
	border: solid 2px #ccc;
	width: 200px;
	outline: none;
}

.main  input:focus {
	border: solid 2px #61ADED;
}

.main  table td.text {
	text-align: right;
}

.main table {
	margin: 0 auto;
}

.main input.submit {
	width: 123px;
	line-height: 123px;
	height: 35px;
	padding: 0px;
	border: none 1px #fff;
	background: url(images/btnok.png) no-repeat left center;
}

.apply {
	font-weight: bold;
	height: 24px;
	line-height: 24px;
	color: #ff6600;
	text-indent: 12px;
}
</style>
	<link href="${pageContext.request.contextPath}/css/reset.css" rel="stylesheet" type="text/css" />
    <link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/utils.js"></script>
	<script type="text/javascript">
$(function() {
	var sWidth = $("#focus").width();
	var len = $("#focus ul li").length;
	var index = 0;
	var picTimer;
	var btn = "<div class='btnBg'></div><div class='btn'>";
	for(var i=0; i < len; i++) {
		btn += "<span>" + (i+1) + "</span>";
	}
	btn += "</div>"
	$("#focus").append(btn);
	$("#focus .btnBg").css("opacity",0);
	$("#focus .btn span").mouseenter(function() {
		index = $("#focus .btn span").index(this);
		showPics(index);
	}).eq(0).trigger("mouseenter");
	$("#focus ul").css("width",sWidth*len);
	$("#focus ul li div").hover(function() {
		$(this).siblings().css("opacity",0.7);
	},function() {
		$("#focus ul li div").css("opacity",1);
	});
	$("#focus").hover(function() {
		clearInterval(picTimer);
	},function() {
		picTimer = setInterval(function() {
			showPics(index);
			index++;
			if(index == len) {index = 0;}
		},5000);
	}).trigger("mouseleave");
	function showPics(index) {
		var nowLeft = -index*sWidth;
		$("#focus ul").stop(true,false).animate({"left":nowLeft},1000);
		$("#focus .btn span").removeClass("on").eq(index).addClass("on");
	}
});

</script>
		<script type="text/javascript">
var tips = [ "请填写您的真实姓名,姓名不能为空！", "请填写您的联系电话,以方便我们联系您,联系电话不能为空！",
		"请填写您所在的学校/院", "请填写您所学的专业", "为了方便我们联系您,提供更好的服务,请您填写常用的Email",
		"请填写您的QQ,可以为空！" ];
$(document).ready(function() {
	$("input:not(.submit)").poshytip( {
		className : 'tip-yellowsimple',
		alignTo : 'target',
		alignX : 'right',
		alignY : 'center',
		offsetX : 0,
		offsetY : 5,
		followCursor : true,
		allowTipHover : false,
		hideAniDuration : 0,
		content : function() {
			return tips[parseInt($(this).attr("tip"))];
		}
	});
});
</script>
<script type="text/javascript">
$(document).ready(function() {
	//$('#aOpen').leanModal({ top: 100, closeButton: ".modal_close" });
		$('a[rel*=leanModal]').leanModal( {
			top : 100,
			closeButton : ".modal_close"
		});
	});
function modal_() {
	$('#lean_overlay').css('display', 'none');
	$('#OpenWindow').css('display', 'none');
	$('#_login_error_msg').remove();
}
</script>
	</head>

	<body>

		<div id="header">
        <div class="tlink">
            <div class="logo">
            </div>
            <div class="navs">
                <ul class="ul">
                	<%if(session.getAttribute("testingedu_user") != null ) {%>
						<li>
							<a href="#">您已登陆</a>
						</li>
						<%} else {%>
						<li>
							<a id="aOpen" href="#OpenWindow" rel="leanModal">用户登陆</a>
							<a href="#" style="display: none" id="_login_yes">您已登陆</a>
						</li>
						<%} %>
                    <li><a href="javascript:addBookmark()">加入收藏</a></li>
                	<li><a href="javascript:setHome()">设为首页</a></li>
                	<li><a href="#">合作咨询</a></li>
                	<li><a href="#">关于我们</a></li>
                </ul>
					<div class="menu">
						<ul>
							<li class="index">
								<a href="${pageContext.request.contextPath}">首页</a>
							</li>
							<li class="split">
								&nbsp;
							</li>
							<li>
								<a
									href="${pageContext.request.contextPath}/resource/list">培训资料</a>
							</li>
							<li class="split">
								&nbsp;
							</li>
							 <li><a href="${pageContext.request.contextPath}/news/list?category_name=课程安排">课程安排</a></li>
                        <li class="split">&nbsp;</li>
							<li>
								<a
									href="${pageContext.request.contextPath}/news/list?category_name=培训大纲">培训大纲</a>
							</li>
							<li class="split">
								&nbsp;
							</li>
							<li>
								<a
									href="${pageContext.request.contextPath}/news/list?category_name=认证大纲">认证大纲</a>
							</li>
							<li class="split">
								&nbsp;
							</li>
							<li>
								<a href="${pageContext.request.contextPath}/teacher/list">教师队伍</a>
							</li>
							<li class="split">
								&nbsp;
							</li>
							<li>
								<a
									href="${pageContext.request.contextPath}/news/list?category_name=就业动态">就业动态</a>
							</li>
							<li class="split">
								&nbsp;
							</li>
							<li>
								<a
									href="${pageContext.request.contextPath}/contact.jsp">在线报名</a>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<div class="banner">
			<div id="focus" style="width: 960px">
				<ul>
					<%List<TIndexPicture> pics = TIndexPictureDao.index(6);
						for(TIndexPicture pic : pics) {%>
					<li style="background-color: white;">
						<div style="left: 0; top: 0; width: 960px; height: 222px;">
							
							<a href=""><img
									src="${pageContext.request.contextPath}/<%=pic.getPath() %>" title="<%=pic.getName() %>"/>
							</a>
						</div>
					</li>
					<%} %>
				</ul>
			</div>
		</div>
		<div id="body">

			<div class="grayspace">
				<div class="apply">
					网络测试培训报名
				</div>
			</div>
			<div class="main">
				<form name="form1" method="post" action="" id="_form">
					<table cellpadding="0" cellspacing="6" border="0">
						<tr>
							<td class="text">
								姓名:
							</td>
							<td>
								<input name="name" type="text" id="_name"
									class="input" tip="0" />
							</td>
						</tr>
						<tr>
							<td class="text">
								联系电话:
							</td>
							<td>
								<input name="phone" type="text" id="_phone" class="input" tip="1" />
							</td>
						</tr>
						<tr>
							<td class="text">
								学院:
							</td>
							<td>
								<input name="school" type="text" id="_school" class="input"
									tip="2" />
							</td>
						</tr>
						<tr>
							<td class="text">
								专业:
							</td>
							<td>
								<input name="major" type="text" id="_major" class="input"
									tip="3" />
							</td>
						</tr>
						<tr>
							<td class="text">
								性别:
							</td>
							<td>
								<span id="RSex" class="rs"
									style="display: inline-block; width: 80px;"><input
										id="RSex_0" type="radio" name="sex" value="m"
										checked="checked" />
									<label for="RSex_0">
										男
									</label>
									<input id="RSex_1" type="radio" name="sex" value="f"/>
									<label for="RSex_1">
										女
									</label>
								</span>
							</td>
						</tr>
						<tr>
							<td class="text">
								Email:
							</td>
							<td>
								<input name="email" type="text" id="tbEmail" class="input"
									tip="4" />
							</td>
						</tr>
						<tr>
							<td class="text">
								QQ:
							</td>
							<td>
								<input name="qq" type="text" id="tbQQ" class="input" tip="5" />
							</td>
						</tr>
						<tr>
							<td class="text">
								&nbsp;
							</td>
							<td>
								<input type="button" name="btnOK" value="" id="btnOK" onclick="save_to_regist();"
									class="submit" />
							</td>
						</tr>
					</table>
				</form>
				<div style="height: 100px;">
					&nbsp;
				</div>

			</div>
		</div>

		<div class="footer">

			<div class="copyright">

				<a href="#">关于测试培训</a> |
				<a href="#">培训流程</a> |
				<a href="#">培训服务</a> |
				<a href="#">联系我们</a> |
				<a href="#">网站地图</a>

				<br />

				<p>

					版权所有：网络测试培训 CopyRight&copy;2010 www.testingedu.com

				</p>

			</div>

		</div>
		<div id="OpenWindow">
			<div id="signup-ct">
				<div id="OpenWindow-header">
					<p>
						用户登录界面
					</p>
					<a href="javascript:modal_()" class="modal_close"></a>
				</div>
				<form action="" method="post" id="_login_form">
					<div class="txt-fld">
						<label for="">
							用户名
						</label>
						<input type="text" name="account" class="good_input" id="_account" />
					</div>
					<div class="txt-fld">
						<label for="">
							密码
						</label>
						<input type="password" name="password" id="_password" />
					</div>
					<div class="btn-fld">
						<button type="button" onclick="user_to_login();">
							登陆  »
						</button>
					</div>
				</form>
			</div>
		</div>
<script type="text/javascript">
function user_to_login() {
	var account = $('#_account').val();
	if(account.length < 3 || account.length > 20) {
		if($('#_login_error_msg').val() == null)
     		$('#OpenWindow-header').append('<p align="center" style="color:red" id="_login_error_msg">登录名长度不正确，应该在3-20位之间</p>');
     	else {
     		$('#_login_error_msg').text('登录名长度不正确，应该在3-20位之间');
     	}
		return;
	}
	var password = $('#_password').val();
	if(password.length < 3 || password.length > 20) {
		if($('#_login_error_msg').val() == null)
     		$('#OpenWindow-header').append('<p align="center" style="color:red" id="_login_error_msg">密码长度不正确，应该在3-20位之间</p>');
     	else {
     		$('#_login_error_msg').text('密码名长度不正确，应该在3-20位之间');
     	}
		return;
	}
	$.ajax({
	   	type: "POST",
	   	url: "${pageContext.request.contextPath}/user/login",
	   	data: $('#_login_form').serialize(),
	   	dataType: "json",
	   	success: function(json){
     		if(json.msg != 'null') {
     			if($('#_login_error_msg').val() == null)
     				$('#OpenWindow-header').append('<p align="center" style="color:red" id="_login_error_msg">'+json.msg+'</p>');
     			else {
     				$('#_login_error_msg').text(json.msg);
     			}
     		}
     		else {
     			if(json.id > 0) {
     				modal_();
     				$('#_login_yes').css('display','block');
     				$('#aOpen').remove();
     				$('#password').attr('value','');
     			}
     		}
   		},
		error: function (XMLHttpRequest, textStatus, errorThrown) {
   					alert("登陆时发生了错误，请重试");
				}
		});
}
function save_to_regist() {
	var name = $('#_name').val();
			if(!utils_stringLength(name, '姓名', 2, 20))
				return;
	var phone = $('#_phone').val();
			if(!utils_stringLength(phone, '电话号码', 9, 15))
				return;
	$.ajax({
	   	type: "POST",
	   	url: "${pageContext.request.contextPath}/regist/recieve",
	   	data: $('#_form').serialize(),
	   	dataType: "json",
	   	success: function(json){
     				window.location.href="${pageContext.request.contextPath}";
   				},
		error: function (XMLHttpRequest, textStatus, errorThrown) {
   					alert("操作时发生了错误，请重试");
				},
		});
}
</script>
	</body>
</html>